/*
 * ses_dcf77.c
 *
 *  Created on: Jun 24, 2011
 *      Author: Andre
 */

#include "ses_common.h"
#include "ses_dcf77.h"

/******************Makros*********************************/

/**
 * Get the state of the DCF77 Data pin
 */
#define DCF77_PINSTATE (PIN(DCF77_PORT) & (1<<DCF77_PIN))

/******************Interval Variables*********************/

uint32_t lastOnTime = 0;

void dcf77_PinToggle(){
	uint32_t diff;

	if(DCF77_PINSTATE){
		led_greenOn();

		/* Difference between last on */
		diff = scheduler_getTime() - lastOnTime;

		/* Save current time */
		lastOnTime = scheduler_getTime();
	} else {
		led_greenOff();
	}


}
